Skip to content

Add simple PyTorch diffusion Schrödinger bridge training example#2

Open
Tumb1eweed wants to merge 2 commits intomainfrom
codex/implement-simple-diffusion-schrodinger-bridge-in-pytorch
Open

Add simple PyTorch diffusion Schrödinger bridge training example#2
Tumb1eweed wants to merge 2 commits intomainfrom
codex/implement-simple-diffusion-schrodinger-bridge-in-pytorch

Conversation

@Tumb1eweed
Copy link
Owner

Motivation

  • 提供一个最小、可运行的教学示例来演示如何用 PyTorch 实现和训练一个简化的扩散薛定谔桥(Diffusion Schrödinger Bridge)。
  • 便于用户用合成数据或 CSV 数据快速复现端点重建与路径重建的基本流程与度量。

Description

  • 新增 dsb_torch.py,包含配对数据集类 BridgePairDataset、合成数据生成器 make_synthetic_bridge_dataset、以及 CSV 导入/导出接口。
  • 实现时间嵌入 TimeEmbedding 与时间条件 MLP 模型 BridgeDenoiser,模型输入为 (x_t, t),输出为 (x0_hat, x1_hat)
  • 增加训练流水线(噪声桥采样 sample_noisy_bridge、训练循环 train)以及验证指标计算 compute_metrics,并在每 epoch 打印 val_lossendpoint_mseendpoint_maepath_mse
  • 更新 README.md,补充依赖、数据格式、使用示例命令和指标说明(包含 --make_synth_csv 用法)。

Testing

  • 成功运行语法检查:python -m py_compile dsb_torch.py(通过)。
  • 试图直接运行短训练(python dsb_torch.py --epochs 2 --n_samples 1000 --batch_size 128)时出现 ModuleNotFoundError: No module named 'numpy'(失败,依赖缺失)。
  • 尝试自动安装依赖(pip install numpy pandas --quiet)在当前环境中因网络/代理限制失败(失败,无法从 PyPI 拉取包)。

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant